package com.zhiliao.observer.spring.client;

import com.zhiliao.observer.spring.DemoEvent;
import com.zhiliao.observer.spring.DemoPublisher;
import com.zhiliao.observer.spring.conf.BeanConfig;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author zouxianfeng
 * @description:
 * @date 2021 2021/6/2 10:59
 */
public class Client {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(BeanConfig.class);
        DemoPublisher bean = context.getBean(DemoPublisher.class);
        bean.publishEvent(new DemoEvent("asd","hello world!`"));

    }
}
